<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
    return response()->json(['welcome web']);

});

//自定义表单二点中转接口
Route::namespace('Maintain')->prefix('admin')->group(function () {
    //获取表单接口1
    Route::post('questionnaire/clone/detail', 'TaskController@admin_questionnaire_clone_detail');

    //获取表单记录接口1
    Route::post('record/detail', 'TaskController@admin_record_detail');

    //创建表单记录接口1
    Route::post('record/add', 'TaskController@admin_record_add');

    //修改表单记录接口1
    Route::post('record/update', 'TaskController@admin_record_update');


    //信息类型列表
    Route::post('get-tag', 'TaskController@get_tag');
    //三方接口-搜索发布
    Route::post('search/callback', 'TaskController@search_callback');

});


//登录接口
Route::namespace('Login')->prefix('login')->group(function () {
    require __DIR__ . '/web/login.php';
});

//用户校验-后台管理
Route::middleware(['web.auth'])->group(function () {
    //用户模块接口
    Route::namespace('Login')->prefix('user')->group(function () {
        require __DIR__ . '/web/user.php';

    });

    //用户模块接口
    Route::namespace('Table')->prefix('table')->group(function () {
        require __DIR__ . '/web/table.php';

    });

    Route::namespace('Maintain')->prefix('maintain')->group(function () {
        require __DIR__ . '/web/maintain.php';

    });


});


Route::namespace('Login')->prefix('login')->group(function () {
    require __DIR__ . '/web/login.php';

});

//用户校验-维护端
Route::middleware(['maintain.auth'])->group(function () {
    Route::namespace('Maintain')->prefix('maintain/maintain')->group(function () {
        require __DIR__ . '/maintain/maintain.php';

    });

    Route::namespace('Maintain')->prefix('maintain/maintain')->group(function () {
        //任务详情
        Route::post('task-detail', 'TaskController@task_detail');

    });

    //用户模块接口
    Route::namespace('Login')->prefix('maintain/user')->group(function () {
//        //地址
//        Route::post('city-china', 'UserController@get_city_china');
//        //微信用户列表
//        Route::post('wechat-user-list', 'UserController@wechat_user_list');
//        //完善用户信息
//        Route::post('add-user-msg', 'UserController@add_user_msg');
        require __DIR__ . '/web/user.php';


    });

    Route::namespace('Table')->prefix('maintain/table')->group(function () {
        //标签维护
        Route::post('tag', 'TableController@tag');

        //标签维护-添加/修改
        Route::post('tag-update', 'TableController@tag_update');

        //标签维护-查看标签
        Route::post('tag-item', 'TableController@tag_item');

        //标签维护-删除标签
        Route::post('tag-delete', 'TableController@tag_delete');



    });

});



